package xyz.maxwells.bigdata.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import xyz.maxwells.bigdata.dao.UploadRepository;
import xyz.maxwells.bigdata.domain.data.Upload;
import xyz.maxwells.bigdata.service.UploadService;

import java.util.List;

/**
 * Created by wuzusheng on 2018/5/16.
 */
@Service
public class UploadServiceImpl implements UploadService {
    @Autowired
    private UploadRepository dao;
    @Override
    public List<Upload> findByUserName(String userName) {
        return dao.findByUserName(userName);
    }

    @Override
    public void delete(Long id) {
        dao.delete(id);
    }

    @Override
    public void save(Upload upload) {
        dao.save(upload);
    }

    @Override
    public Page<Upload> list(Specification<Upload> spec, Pageable pageable) {
        return dao.findAll(spec,pageable);
    }
}
